/**
 * \class AbsSyn.cpp /GenProg/AbsSyn/AbsSyn.cpp
 *
 *  \date 3 maj 2012
 *  \author calle
 *  
 *  \brief module class
 */

#include "AbsSyn.h"
#include <Interfaces/IExp.h>
#include <AbsSyn/IntExp.h>
#include <AbsSyn/DoubleExp.h>
#include <AbsSyn/BoolExp.h>
#include <AbsSyn/AddExp.h>
#include <AbsSyn/IdentExp.h>
#include <AbsSyn/Ident.h>
#include <Generator/GenIdent.h>
#include <Helpers/ExpRegistry.h>
#include <AbsSyn/GenExpClasses/GenAddExp.h>
#include <AbsSyn/GenExpClasses/GenModExp.h>
#include <AbsSyn/GenExpClasses/GenBoolExp.h>
#include <AbsSyn/GenExpClasses/GenDoubleExp.h>
#include <AbsSyn/GenExpClasses/GenIntExp.h>
#include <AbsSyn/GenExpClasses/GenIdentExp.h>


AbsSyn::AbsSyn(ExpRegistry& registry)
{
	//Register the functions to create Expressions.
	//GenExp genExp(registry);
	//Generation of ident's
	GenIdent genIdent;




	ExpRegistry::TGenPtr boolGen(new GenBoolExp(&BoolExp::generateBoolExp) );
	registry.addGenFun(TerminalState::TERMINAL,ExpressionType::BOOL_EXP,boolGen);

	ExpRegistry::TGenPtr dblGen( new GenDoubleExp(&DoubleExp::genreateDblExp) );
	registry.addGenFun(TerminalState::TERMINAL,ExpressionType::DOUBLE_EXP,dblGen);

	ExpRegistry::TGenPtr intGen(new GenIntExp(&IntExp::generateIntExp) );
	registry.addGenFun(TerminalState::TERMINAL,ExpressionType::INT_EXP,intGen);


	ExpRegistry::TGenPtr identExp(new GenIdentExp(genIdent) );
	registry.addGenFun(TerminalState::TERMINAL,ExpressionType::IDENT_EXP,identExp);

	ExpRegistry::TGenPtr addPtr( new GenAddExp(&AddExp::generateAddExp) );
	registry.addGenFun(TerminalState::NON_TERMINAL,ExpressionType::ADD_EXP,addPtr);

	ExpRegistry::TGenPtr modPtr( new GenModExp( &ModulusExp::generateModExp ) );
	registry.addGenFun(TerminalState::NON_TERMINAL,ExpressionType::MOD_EXP,modPtr);
}



AbsSyn::~AbsSyn()
{
}











